/* 统一管理项目接口地扯 */
import axios from '@/request/request'
import qs from "qs"
/* 获取精品推荐的数据  */
export const JingpinApi = () => axios.get('/products/recommend')
/* 获取热口数据 */
export const RemenApi = () => axios.get('/products/hot')
/* 发送短信验证码  带参数 */
export const SendMSAPI=(params) => axios.post('/sendSMS',qs.stringify(params))
// console.log('序列化',qs.stringify({a:10,b:100}))
/* 登录请求 */
export const phoneReginAPI=(params) => axios.post('/phoneRegin',qs.stringify(params))
/* // 微信登录（这个接口必须用qs对数据进行格式化） */

export const WeixinLoginApi = (params) => axios.post('/wechatUsers/PCLogin', qs.stringify(params));
export const bindingAPI = (params) => axios.post('/wechatUsers/binding', qs.stringify(params));
/* 用户信息 */
/* 商品详情 */
export const Details = (id) => axios.get(`/products/${id}`)
//删除商品
export const delCart = (id) => axios.delete(`/shop/carts?productIds=${id}`)

export const userInfo = () => axios.get('/shop/userProfiles');
//添加到购物车

export const addShop = (params) => axios.post('/shop/carts/add', qs.stringify(params));
//全部商品
export const GoodSearchApi = (params) => axios.get(`/products`,{params})   //变量名和属性值 一样，可以简写
//查看购物车

export const Cart = () => axios.get('/shop/carts')